<template>
	<view>
		<map v-show="false" :latitude="latitude" :longitude="longitude"></map>
	</view>
</template>

<script>
	export default {
		props: {
			tude: {
				type: Object,
				default: function() {
					return {};
				}
			},
		},
		data() {
			return {
				latitude: this.tude.latitude,
				longitude: this.tude.longitude,
			}
		},
		mounted() {
			this.getLocationInfo()
		},
		methods: {
			getLocationInfo() {
				const that = this
				uni.chooseLocation({
					success(res) {
						uni.$emit("mapData", res)
					},
					fail(res) {
						if(res.errMsg == "chooseLocation:fail cancel") that.$emit("closeMap", "")
					}
				})
			},
		}
	}
</script>